package com.sntk.registermanager.common.infrastructure.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName: OperatorInfo
 * @author: wgchao
 * @createTime: 2020/7/13 3:41 PM
 * @Description: TODO
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OperatorInfo {
    private String operator;
    private String operatorName;
    private String institutionNumber;
    private Integer userType;

    /**
     * 机构是否为操作人本机构或下属机构
     * @param institutionNumber
     * @return
     */
    public boolean isChild(String institutionNumber){
        return institutionNumber.startsWith(this.institutionNumber);
    }

    /**
     * 是否为管理员账户
     * @return
     */
    public boolean isAdmin(){
        return this.userType == 0;
    }
}
